home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 February / MacFormat 87.iso / Shareware Plus / Utilities / Envelope Window ƒ / Sample Scripts / Import EE+ File next >
Encoding:
Text File  |  1999-12-09  |  805 b   |  31 lines  |  [TEXT/ToyS]

  1. tell application "Envelope Window 1.1"
  2.     activate
  3.     
  4.     set myfile to choose file with prompt "Choose the Easy Envelopes address list to import"
  5.     set mydelimiters to return --type the delimiter character used by your address program between the quotes
  6.     
  7.     set old_delims to AppleScript's text item delimiters
  8.     
  9.     set myinput to open for access myfile
  10.     set mylist to read myinput using delimiters mydelimiters as list
  11.     
  12.     set this_address to ""
  13.     
  14.     repeat with each_address in mylist
  15.         
  16.         set this_line to each_address & return
  17.         
  18.         if this_line is mydelimiters then
  19.             
  20.             if this_address is not "" then
  21.                 add address this_address
  22.             end if
  23.             
  24.             set this_address to ""
  25.         else
  26.             set this_address to this_address & this_line
  27.         end if
  28.     end repeat
  29.     
  30.     set AppleScript's text item delimiters to old_delims
  31. end tell